<template>
    <div class="">
        <div class="crumbs">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item><i class="el-icon-message"></i>&nbsp;查看展会</el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <div class="container">
            <el-form  label-width="160px">
                <el-form-item label="展会ID：">
                    <div>
                        {{data.id}}
                    </div>
                </el-form-item>
                <el-form-item label="展会类型：">
                    <div>
                        {{data.trans_type}}
                    </div>
                </el-form-item>
                <el-form-item label="展会时间段：">
                    <div>
                        {{data.time_slot}}
                    </div>
                </el-form-item>
                <el-form-item label="封面图：">
                    <div>
                        <img :src="data.head_img" style="width:300px;height:150px;"/>
                    </div>
                </el-form-item>
                <el-form-item label="展会标题：">
                    <div>
                        {{data.title}}
                    </div>
                </el-form-item>
                
                <el-form-item label="详情内容：">
                    <div style="width:800px;height:auto;">
                        <div v-html="data.content" style="padding:0px 10px 50px 10px"></div>
                    </div>
                </el-form-item>
                <el-form-item label="来源：">
                    <div>
                        {{data.source}}
                    </div>
                </el-form-item>
                <el-form-item label="授权：">
                    <div>
                        {{data.authorize}}
                    </div>
                </el-form-item>
                <el-form-item label="关键词：" v-if="keywords.length>0">
                    <div>
                        <div>
                            <el-tag v-for="value in keywords" :key="value">{{value}}</el-tag>
                        </div>
                    </div>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="returnList">返回列表</el-button>
                </el-form-item>
            </el-form>
        </div>
       
    </div>
</template>
<script>
import {exbQuery} from '@/api/school'
export default {
    name:"exbQuery",
    data() {
        return {
            id:0, //ID
            data:{keywords:[]},
            keywords:[]
        }
    },
    //实例创建
    created(){
        if(this.$route.query.id &&this.$route.query.id!=""){
            this.id = this.$route.query.id;
            this.getData();
        }else{
            //学院详情
            alert("获取展会详情ID失败")
        }
    },
    //计算属性
    computed:{
        tagList (){
            
        }
    },
    //方法
    methods: {
        //获取学院资讯详情
        getData(){
            // console.log(this.id)
            exbQuery(this.id).then(res=>{
                // console.log(res);
                if(res.code==200){
                     var data = res.data;
                     this.keywords = JSON.parse(data.keywords);
                        if(this.keywords[0] == ''){
                        this.keywords = [];
                    }
                    this.data = data;
                    console.log(data);
                }else{

                }

            })
        },
        //返回列表
        returnList (){
          this.$router.go(-1);
        }
    }
}
</script>
<style lang="stylus" scoped>
    .el-form-item .el-cascader{
        width :400px;
    }
    .el-cascader-menus .el-cascader-menu{
        width :240px
    }
    .sola-upload{
        .sola-left{
            width :100%;
            height :auto;
            .sola-flex{
                float:left
                width: 360px;
                height: 180px;
                margin-bottom 20px;
                margin-right:15px;
                position:relative;
                .delete{
                    position:absolute;
                    top:2px;
                    right:13px;
                    color: #f56c6c;
                    display:inline-block;
                    padding:5px 5px;
                    .el-alert__icon{font-size:28px;cursor:pointer}
                }
                img {
                    width:100%;
                    height:100%;
                }
            }
        }
        .sola-file-box{
            position:relative;
            .btn-file{
                position:absolute;
                top:0;
                left:0;
                z-index 1;
                opacity:0;
                width :120px;
                height :40px;
                outline: 0;
                background-color :none;
                cursor:pointer;
            }
        }

    }
</style>


